import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const querySysTenantMenuRelation = (params) => {
  params.head.transCode = 'querySysTenantMenuRelation';
  return request({
    url: '/platform/sysTenantMenuRelation/querySysTenantMenuRelation',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const querySysTenantMenuRelationListPage = (params) => {
  params.head.transCode = 'querySysTenantMenuRelationListPage';
  return request({
    url: '/platform/sysTenantMenuRelation/querySysTenantMenuRelationListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveSysTenantMenuRelation = (params) => {
  params.head.transCode = 'saveSysTenantMenuRelation';
  return request({
    url: '/platform/sysTenantMenuRelation/saveSysTenantMenuRelation',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveSysTenantMenuRelationList = (params) => {
  params.head.transCode = 'saveSysTenantMenuRelationList';
  return request({
    url: '/platform/sysTenantMenuRelation/saveSysTenantMenuRelationList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateSysTenantMenuRelation = (params) => {
  params.head.transCode = 'saveOrUpdateSysTenantMenuRelation';
  return request({
    url: '/platform/sysTenantMenuRelation/saveOrUpdateSysTenantMenuRelation',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateSysTenantMenuRelationList = (params) => {
  params.head.transCode = 'saveOrUpdateSysTenantMenuRelationList';
  return request({
    url: '/platform/sysTenantMenuRelation/saveOrUpdateSysTenantMenuRelationList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateSysTenantMenuRelation = (params) => {
  params.head.transCode = 'updateSysTenantMenuRelation';
  return request({
    url: '/platform/sysTenantMenuRelation/updateSysTenantMenuRelation',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteSysTenantMenuRelation = (params) => {
  params.head.transCode = 'deleteSysTenantMenuRelation';
  return request({
    url: '/platform/sysTenantMenuRelation/deleteSysTenantMenuRelation',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteSysTenantMenuRelationList = (params) => {
  params.head.transCode = 'deleteSysTenantMenuRelationList';
  return request({
    url: '/platform/sysTenantMenuRelation/deleteSysTenantMenuRelationList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportSysTenantMenuRelationExcel = (params) => {
  params.head.transCode = '';
  downloadExcel({
    url: '/platform/sysTenantMenuRelation/excelDownload/exportSysTenantMenuRelationExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
